package com.sh.job.snailjob;

import com.aizuda.snailjob.client.job.core.annotation.JobExecutor;
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
import com.aizuda.snailjob.client.model.ExecuteResult;
import com.aizuda.snailjob.common.core.util.JsonUtil;
import com.aizuda.snailjob.common.log.SnailJobLog;
import com.sh.business.service.facade.UserServiceFacade;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * @author ruoyi
 * @date 2024-05-17
 */
@RequiredArgsConstructor
@Component
@JobExecutor(name = "dailyProduceJobExecutor")
public class DailyProduceAnnoJobExecutor {

    private final UserServiceFacade userServiceFacade;

    public ExecuteResult jobExecute(JobArgs jobArgs) {
        SnailJobLog.LOCAL.info("DailyProduceAnnoJobExecutor. jobArgs:{}", JsonUtil.toJsonString(jobArgs));

        userServiceFacade.mining();

        SnailJobLog.REMOTE.info("DailyProduceAnnoJobExecutor. jobArgs:{}", JsonUtil.toJsonString(jobArgs));
        return ExecuteResult.success("成功");
    }
}
